A color space conversion is often required for handling color data of an electronic document or an image over different computing systems such as a personal computer (PC) or a printer system. In general, a suitable color space is selected depending on the computing system. For example, an RGB color space is generally used for a PC to display electronic documents and images on a monitor, and a CMYK color space is used for a printer system to output print data on paper. Thus, the printer system must convert the print data from RGB to CMYK before printing.
Some color data may need additional conversions before and after the color space conversion. Such color data may contain color values (e.g., red, green, and blue in the RGB color space) as well as an alpha-channel value (e.g., 0-100%), which is normally used as an opacity channel. To represent the degree of transparency, each color value is multiplied by the alpha-channel value. In general, two kinds of representations are known for representing the same color with opacity—straight and premultiplied.
In the straight representation, the color values (i.e., red, green, and blue) are not multiplied by the alpha-channel. On the other hand, in the premultiplied representation, the color values are premultiplied by the alpha value. For example, if an electronic document specifies a red pixel in the RGB color space (RGB=255, 0, 0) that is 50% transparent (alpha=127), the premultiplied color data will actually be RGBa=(127, 0, 0, 127).
However, a conventional color management module is focused strictly on converting colors from one color space to another. Thus, feeding premultiplied color into the color management module may result in incorrect output. Continuing with the example above, color converting a half transparent premultiplied red pixel will require inputting RGB=(127, 0, 0) into the color management module. Although the intended color is pure red, the color data that will come out of color conversion is actually a dark red color in the new color space. Accordingly, any premultiplied input data that needs to be color converted must first be “un-premultiplied.” Furthermore, the converted color data needs to be “re-premultiplied” for applications that expect the color data to be premultiplied.
Conventionally, the following steps have been performed to execute color conversion for premultiplied color data from RGBa (RGB+alpha channel) to CMYKa (CMYK+alpha channel):                Step 1: Un-premultiply all color pixels (RGBa) to restore the color data to a representation expected by the conventional color conversion module.        Step 2: Send all color pixels to the conventional color conversion module to convert the colors from RGBa to CMYKa.        Step 3: Re-premultiply all color pixels to restore the color data to a premultiplied state (CMYKa) if additional processing on the data expects a premultiplied state.        
Although there is not a significant CPU cost to the “un-premultiplication” step (Step 1) and “re-premultiplication” step (Step 3), there is a significant memory cost. First the computing system must “un-premultiply” an entire scanline of four channels (RGBa) into a separate buffer of three channels (RGB). This requires accessing a memory to read and write each pixel in the scanline once. Then, the Color Management Module converts an entire scanline of 3 channels (RGB) into a separate buffer of 4 channels (CMYK), again accessing the memory to read and write each pixel once. Then, a third pass may be needed to “re-premultiply” an entire scanline of 4 channels (CMYK) into a separate buffer of 5 channels (CMYKa), requiring a third memory access to read and write each pixel.
Although the calculation is not expensive, the three-step conversions require excessive memory access and negatively affect performance of a system executing color conversion.